% -------------------------------------------------------------------------
% EXAMPLE: ROCKET Propellants
%
% Compute adiabatic temperature and equilibrium composition at constant
% pressure (e.g., 200 bar) for lean to rich RP_1-LOX mixtures at
% standard conditions, a set of 76 species considered and a set of
% equivalence ratios phi contained in (1, 6) [-]
%   
% HC/O2/N2 PROPELLANTS == {'CO2','CO','H2O','H2','O2','N2','He','Ar',...
%                'Cbgrb','C2','C2H','C2H2_acetylene','C2H2_vinylidene',...
%                'C2H3_vinyl','C2H4','C2H5','C2H5OH','C2H6',...
%                'C2N2','C2O','C3','C3H3_1_propynl',...
%                'C3H3_2_propynl','C3H4_allene','C3H4_propyne',...
%                'C3H5_allyl','C3H6O_acetone','C3H6_propylene',...
%                'C3H8','C4','C4H2_butadiyne','C5','C6H2','C6H6',...
%                'C8H18_isooctane','CH','CH2','CH2CO_ketene',...
%                'CH2OH','CH3','CH3CHO_ethanal','CH3CN',...
%                'CH3COOH','CH3O','CH3OH','CH4','CN','COOH','H',...
%                'H2O2','HCCO','HCHO_formaldehy','HCN','HCO',...
%                'HCOOH','HNC','HNCO','HNO','HO2','N','N2O',...
%                'NCO','NH','NH2','NH2OH','NH3','NO','NO2',...
%                'O','OCCN','OH','C3O2','C4N2','RP_1','H2bLb',...
%                'O2bLb'}
%   
% See wiki or setListspecies method from ChemicalSystem class for more
% predefined sets of species
%
% @author: Alberto Cuadra Lara
%          Postdoctoral researcher - Group Fluid Mechanics
%          Universidad Carlos III de Madrid
%                 
% Last update April 05 2022
% -------------------------------------------------------------------------

LS = {'CO2','CO','H2O','H2','O2','N2','He','Ar',...
       'Cbgrb','C2','C2H','C2H2_acetylene','C2H2_M',...
       'C2H3_vinyl','C2H4','C2H5_M','C2H5OH','C2H6',...
       'C2N2','C2O','C3','C3H3_1_propynl',...
       'C3H3_2_propynl','C3H4_allene','C3H4_propyne',...
       'C3H5_allyl','C3H6O_acetone','C3H6_propylene',...
       'C3H8','C4','C4H2_butadiyne','C5','C6H2','C6H6',...
       'C8H18_M','CH','CH2_M','CH2CO_ketene',...
       'CH2OH','CH3_M','CH3CHO_ethanal','CH3CN',...
       'CH3COOH','CH3O','CH3OH_M','CH4','CN','COOH','H',...
       'H2O2_M','HCCO_M','HCHO_M','HCN','HCO',...
       'HCOOH','HNC','HNCO','HNO','HO2_M','N','N2O',...
       'NCO','NH','NH2','NH2OH','NH3','NO','NO2',...
       'O','OCCN','OH','C3O2','C4N2','RP_1','H2bLb',...
       'O2bLb','CH3CH_M','CH2D2_M','CH2O2_M','CH2OH_M',...
       'CH2O_M','C2H2O_M','C2H2O2_M','C2H4O2_M','C2H3O2_M',...
       'C3H2_M','C3H3_1_propynl_M','COC_M','COH_M',...
       'COO_M','HCbOOb_M','HCC_OH_M','HCOO_M'};

%% INITIALIZE
self = App('SOOT FORMATION EXTENDED');
self.TN.tolN = 1e-18;
%% INITIAL CONDITIONS
self = set_prop(self, 'TR', 298.15, 'pR', 30, 'phi', 2);
self.PD.S_Fuel = {'RP_1'};
self.PD.S_Oxidizer = {'O2bLb'};
self.PD.FLAG_IAC = false;
%% ADDITIONAL INPUTS (DEPENDS OF THE PROBLEM SELECTED)
self = set_prop(self, 'Aratio_c', 2, 'Aratio', 2.62);
%% SOLVE PROBLEM
self = solve_problem(self, 'ROCKET');
%% DISPLAY RESULTS (PLOTS)
self.C.mintol_display = 1e-10;
post_results(self);